home *** CD-ROM | disk | FTP | other *** search
- #!/usr/bin/perl5
- #
- # connect-t1.cgi
- #
- # Copyright 1988-1996 Silicon Graphics, Inc.
- # All rights reserved.
- #
- # This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- # the contents of this file may not be disclosed to third parties, copied or
- # duplicated in any form, in whole or in part, without the prior written
- # permission of Silicon Graphics, Inc.
- #
- # RESTRICTED RIGHTS LEGEND:
- # Use, duplication or disclosure by the Government is subject to restrictions
- # as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- # and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- # successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- # rights reserved under the Copyright Laws of the United States.
- #
- # $Id: connect-t1.cgi,v 1.29 1997/04/17 23:43:44 shotes Exp $
-
- require "/usr/OnRamp/lib/OnRamp.pm";
-
- if (!$ARGV[0]) { printf("Location: %s%c%c","/tasks/Tasks.connect-start.cgi",10,10); }
-
- $myname = "connect-t1.cgi";
- $temp = "task.tmp";
- $action= "connect-t1.cgi?loop";
-
- $it = "<td align=right><font size=4>";
- $ni = "</font></td>";
- $bo = "<td><br><font size=5><i>";
- $nb = "</i></font></td>";
-
- @find_vals = ('port');
-
- &get_fields;
-
- if ($ARGV[0] eq 'loop') { %vals = %fld; }
- else { &readValues; }
-
- if ($ARGV[0] eq loop) {
- &errorCheck;
- &writeFile;
-
- $go = "/tasks/connect-end.cgi?t";
- #printf("Location: %s%c%c",$go,10,10);
- print "Content-type: text/html\n\n";
- print "<HTML><HEAD>";
- print "<META HTTP-EQUIV=\"refresh\" CONTENT=\"0; URL=$go\">";
- print "</HEAD><BODY></BODY></HTML>";
- exit 0;
- }
-
-
- &generic;
-
- sub readValues {
- open(IN,"< $temp");
- while(<IN>) {
- @items = split(/=/);
- foreach $arg (@find_vals) {
- if ($arg eq $items[0]) {
- if ($items[1] ne "\n") {
- $vals{$arg} = $items[1];
- chop $vals{$arg};
- }
- }
- }
- }
- close(IN);
- }
-
- sub errorCheck {
- }
-
- sub error {
- $error = $_[0];
- &generic;
- exit 0;
- }
-
- sub writeFile {
- undef %terms;
- open(IN,"< $temp");
- while(<IN>) {
- @items = split(/=/);
- chop $items[1];
- $terms{$items[0]} = $items[1];
- }
- close(IN);
- foreach $arg (@find_vals) {
- $terms{$arg} = $fld{$arg};
- }
- open(OUT,"> $temp");
- foreach $arg (keys(%terms)) {
- print OUT "$arg=$terms{$arg}\n";
- }
- close(OUT);
- }
-
- sub generic {
- print "Content-type: text/html\n\n";
- print "<html><head><title>T1 Configuration</title>\n";
- print "<script language=\"JavaScript\">\n<!--\n";
-
- # JavaScript
- print "function Next() {
- setTimeout('document.t1.submit()',0);
- return;
- }\n";
- print "function Previous() {
- setTimeout('window.location=\"connect-second.cgi?t\"',0);
- return;
- }\n";
- print "function errorBox (Ctrl, ErrorMessage) {
- alert (ErrorMessage); Ctrl.focus(); return;
- }\n";
-
- print "//-->\n";
- print "</script></head>\n\n";
-
- print "<body bgcolor=\'c7ded4\' background=/tasks/connect-task.bg.gif>\n";
-
- if ($error) {
- print "<font size=4><b>Error: </b>$error<br></font>";
- }
- print "<i>$message</i>";
-
- print "<table width=100%>",
- "<tr><th align=left><h1>T1 Configuration</h1></th>\n",
- "<th align=right><a href=\"/newsplash.shtml\">",
- "<img height=55 width=57 border=0 src=/tasks/home.gif></a>\n",
- " <a href=\"/tasks/Tasks.shtml\">",
- "<img height=55 width=57 border=0 src=/tasks/back.gif></a>",
- "</tr></table>\n";
-
- printf("<form name=\"t1\" action=\"%s\" method=post>\n", $action);
-
- print "<center><table width=620>";
-
- print "<tr valign=top>$bo Port for your T1 connection: <br> <br> <br> <br>$nb \n$it",
- &select("port",$vals{'port'},
- 'Port 1',
- 'Port 2'),
- "<br> <br>$ni</tr>\n";
-
- print "</table></center>\n";
-
- print '<MAP NAME="js_map1">',
- ' <AREA SHAPE="rect" COORDS="0,0,59,52" HREF="javascript:Previous()"
- onMouseOver="window.status=\'\';return true">',
- '</MAP>';
- print "\n";
- print '<MAP NAME="js_map2">',
- ' <AREA SHAPE="rect" COORDS="0,0,59,52" HREF="javascript:Next()"
- onMouseOver="window.status=\'\';return true">',
- '</MAP>';
- print "\n";
- print '<IMG SRC="/tasks/rightarrow.gif" BORDER=0 USEMAP="#js_map2" align="right">';
- print "\n";
- print '<IMG SRC="/tasks/leftarrow.gif" BORDER=0 USEMAP="#js_map1" align="right">';
-
- print "\n</form></body></html>";
- }
-
-